PROP_CUSTOM_TAB_LABEL,
PROP_EMBED_PAGE_SETUP,
PROP_HAS_SELECTION,
- PROP_SUPPORT_SELECTION
+ PROP_SUPPORT_SELECTION,
+ PROP_N_PAGES_TO_PRINT
};
static guint signals[LAST_SIGNAL] = { 0 };
case PROP_SUPPORT_SELECTION:
g_value_set_boolean (value, priv->support_selection);
break;
+ case PROP_N_PAGES_TO_PRINT:
+ g_value_set_int (value, priv->nr_of_pages_to_print);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
P_("TRUE if page setup combos are embedded in GtkPrintDialog"),
FALSE,
GTK_PARAM_READWRITE));
+ /**
+ * GtkPrintOperation:n-pages-to-print:
+ *
+ * The number of pages that will be printed.
+ *
+ * Note that this value is set during print preparation phase
+ * (%GTK_PRINT_STATUS_PREPARING), so this value should never be
+ * get before the data generation phase (%GTK_PRINT_STATUS_GENERATING_DATA).
+ * You can connect to the #GtkPrintOperation::status-changed signal
+ * and call gtk_print_operation_get_n_pages_to_print() when
+ * print status is %GTK_PRINT_STATUS_GENERATING_DATA.
+ * This is typically used to track the progress of print operation.
+ *
+ * Since: 2.18
+ */
+ g_object_class_install_property (gobject_class,
+ PROP_N_PAGES_TO_PRINT,
+ g_param_spec_int ("n-pages-to-print",
+ P_("Number of Pages To Print"),
+ P_("The number of pages that will be printed."),
+ -1,
+ G_MAXINT,
+ -1,
+ GTK_PARAM_READABLE));
}
/**
return op->priv->has_selection;
}
+/**
+ * gtk_print_operation_get_n_pages_to_print:
+ * @op: a #GtkPrintOperation
+ *
+ * Returns the number of pages that will be printed.
+ *
+ * Note that this value is set during print preparation phase
+ * (%GTK_PRINT_STATUS_PREPARING), so this function should never be
+ * called before the data generation phase (%GTK_PRINT_STATUS_GENERATING_DATA).
+ * You can connect to the #GtkPrintOperation::status-changed signal
+ * and call gtk_print_operation_get_n_pages_to_print() when
+ * print status is %GTK_PRINT_STATUS_GENERATING_DATA.
+ * This is typically used to track the progress of print operation.
+ *
+ * Returns: the number of pages that will be printed
+ *
+ * Since: 2.18
+ **/
+gint
+gtk_print_operation_get_n_pages_to_print (GtkPrintOperation *op)
+{
+ g_return_if_fail (GTK_IS_PRINT_OPERATION (op));
+
+ return op->priv->nr_of_pages_to_print;
+}
+
#define __GTK_PRINT_OPERATION_C__
#include "gtkaliasdef.c"